﻿
using System;
using System.Collections.Generic;
namespace Kindler.IO.MobiFile
{
    public class MobiFileHeader
    {
        [MobiProperty(0)]
        public MobiFileCompression Compression { get; set; }

        [MobiProperty(1)]
        public UInt16 Unused { get; set; }

        [MobiProperty(2)]
        public UInt32 TextLength { get; set; }

        [MobiProperty(3)]
        public UInt16 RecordCount { get; set; }

        [MobiProperty(4)]
        public UInt16 RecordSize { get; set; }

        [MobiProperty(5)]
        public MobiFileEncryption EncryptionType { get; set; }

        [MobiProperty(6, LengthInBytes = 2)]
        public byte[] Unknown { get; set; }

        [MobiProperty(7, LengthInBytes = 4)]
        public string Identifier { get; set; }

        [MobiProperty(8)]
        public UInt32 HeaderLength { get; set; }

        [MobiProperty(9, LengthInBytes = 4)]
        public MobiFileType MobiFileType { get; set; }

        [MobiProperty(10, LengthInBytes = 4)]
        public MobiFileTextEncoding TextEncoding { get; set; }

        [MobiProperty(11)]
        public UInt32 UniqueId { get; set; }

        [MobiProperty(12)]
        public UInt32 GeneratorVersion { get; set; }

        [MobiProperty(13, LengthInBytes = 40)]
        public byte[] Reserved { get; set; }

        [MobiProperty(14)]
        public UInt32 FirstNonBookIndex { get; set; }

        [MobiProperty(15)]
        public UInt32 FullNameOffset { get; set; }

        [MobiProperty(16)]
        public UInt32 FullNameLength { get; set; }

        [MobiProperty(17)]
        public UInt32 Locale { get; set; }

        [MobiProperty(18)]
        public UInt32 InputLanguage { get; set; }

        [MobiProperty(19)]
        public UInt32 OutputLanguage { get; set; }

        [MobiProperty(20)]
        public UInt32 FormatVersion { get; set; }

        [MobiProperty(21)]
        public UInt32 FirstImageIndex { get; set; }

        [MobiProperty(22, LengthInBytes = 16)]
        public byte[] Unknown2 { get; set; }

        [MobiProperty(23)]
        public UInt32 ExthIndicator { get; set; }

        [MobiProperty(24, LengthInBytes = 36)]
        public byte[] Unknown3 { get; set; }

        [MobiProperty(25)]
        public UInt32 DrmOffset { get; set; }

        [MobiProperty(26)]
        public UInt32 DrmCount { get; set; }

        [MobiProperty(27)]
        public UInt32 DrmSize { get; set; }

        [MobiProperty(28)]
        public UInt32 DrmFlags { get; set; }

        [MobiProperty(29, LengthInBytes = 62)]
        public byte[] Unknown4 { get; set; }

        [MobiProperty(30, LengthInBytes = 2)]
        public byte[] ExtraDataFlags { get; set; }

        [MobiProperty(31, LengthInBytes = 4)]
        public string ExthIdentifier { get; set; }

        [MobiProperty(32)]
        public UInt32 ExthHeaderLength { get; set; }

        [MobiProperty(33)]
        public UInt32 ExthRecordCount { get; set; }

        [MobiProperty(34)]
        public IEnumerable<ExthRecord> ExthRecords { get; set; }
    }
}
